package com.googlecode.payroll

class SalaryController {

    def paymentCalculationService

    def index = {
        redirect(action:list, params:params)
    }

    def list = {
        [salaryInstanceList: [], salaryInstanceTotal: 0]
    }

    def calculate = {
        params.max = 20
        def salaryList = paymentCalculationService.calculateSalary(params.month)
        render(view:'list', model:[salaryInstanceList: salaryList, salaryInstanceTotal: salaryList.size])
    }

}
